/**  

* @author renbangjie renbangjie@126.com  
* @version V1.0  
*/
package com.ai.service.reviewed.service.impl;

import java.util.Date;
import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.ai.common.core.mapper.Mapper;
import com.ai.common.core.service.impl.BaseServiceImpl;
import com.ai.mmd.reviewed.dto.JzxtlinfoDTO;
import com.ai.service.reviewed.dao.JzxtlinfoModelMapper;
import com.ai.service.reviewed.model.JzxtlinfoModel;
import com.ai.service.reviewed.service.IJzxtlinfoService;

/**
* 
*	登陆信息的业务实现类
* 
* @author renbangjie renbangjie@126.com
*/
@Service("ijzxtlinfoService")
public class JzxtlinfoServiceImpl extends BaseServiceImpl<JzxtlinfoModel>
		implements IJzxtlinfoService {
	
	/**
	 * 编辑货票单
	 * @param JzxslinfoDTO
	 * @return
	 * @throws Exception
	 */
	public void edithpd(JzxtlinfoDTO jzxtlinfoDTO)throws Exception {
		
		JzxtlinfoModel jzxtlinfoModel = new JzxtlinfoModel();
		BeanUtils.copyProperties(jzxtlinfoDTO, jzxtlinfoModel);
		if (jzxtlinfoDTO.getId()!=null) {
			//更新
			jzxtlinfoModel.setGxsj(new Date());
			jzxtlinfoModelMapper.updateByPrimaryKey(jzxtlinfoModel);
		}else{
			//新增
			jzxtlinfoModel.setCjsj(new Date());
			jzxtlinfoModel.setGxsj(new Date());
			jzxtlinfoModelMapper.insert(jzxtlinfoModel);
		}
	}
	
	@Resource(name = "jzxtlinfoModelMapper")
	private JzxtlinfoModelMapper jzxtlinfoModelMapper;
	
	@Override
	protected Mapper<JzxtlinfoModel> getMapper() {
		return jzxtlinfoModelMapper;
	}

}
